package com.example.logindemo2.view

import android.content.Context
import android.content.Intent
import com.example.logindemo2.R

class MainActivity : BaseActivity() {

    override fun getLayoutId(): Int = R.layout.activity_main

    //从主界面退出后直接退出app, 而不是返回登录界面
//    override fun onDestroy() {
//        super.onDestroy()
//        AppManager.instance.exitApp(this)
//    }

    companion object {
        fun startMainActivity(context: Context, needNewTaskFlag: Boolean) {
            val intent = Intent(context, MainActivity::class.java)
            if (needNewTaskFlag) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(intent)
        }
    }
}